package rhc.discribute.node.sendMessage;

import java.util.concurrent.CountDownLatch;

import rhc.discribute.node.connecter.impl.ZKPathLockData;
import rhc.discribute.node.connecter.impl.zookper.ZKExecute;

/**发送消息时需要保持的数据以便回调
 * @author rhc
 *
 */
public class SendMessageData {

	private String messagePath;
	
	private CountDownLatch latch;
	
	private ZKExecute zkExecute;
	
	private SendMessageCallback callback;
	
	private ZKPathLockData zkLockData;
	
	public SendMessageData(String messagePath,CountDownLatch latch,ZKExecute zkExecute,ZKPathLockData zkLockData,SendMessageCallback callback){
		this.messagePath=messagePath;
		this.latch=latch;
		this.zkExecute=zkExecute;
		this.callback=callback;
		this.zkLockData=zkLockData;
	}

	public String getMessagePath() {
		return messagePath;
	}

	public void setMessagePath(String messagePath) {
		this.messagePath = messagePath;
	}

	public CountDownLatch getLatch() {
		return latch;
	}

	public void setLatch(CountDownLatch latch) {
		this.latch = latch;
	}

	public ZKExecute getZkExecute() {
		return zkExecute;
	}

	public void setZkExecute(ZKExecute zkExecute) {
		this.zkExecute = zkExecute;
	}

	public SendMessageCallback getCallback() {
		return callback;
	}

	public void setCallback(SendMessageCallback callback) {
		this.callback = callback;
	}
	
	public void clear(){
		this.zkExecute=null;
	}

	public ZKPathLockData getZkLockData() {
		return zkLockData;
	}

	public void setZkLockData(ZKPathLockData zkLockData) {
		this.zkLockData = zkLockData;
	}
	
}
